<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SupportedFacManagement.ascx.cs" Inherits="admin_SupportedFacManagement" %>
<script type="text/javascript">
var url="Default.aspx?ctrl=fac_place&mode=det&fac_id=";
function redirect(){
url+=document.getElementById("<%=cmbFacility.ClientID %>").value;
window.location.href=url;
}
</script>
<asp:Panel ID="pnlMain" runat="server">
<table>
    <tr>
        <td style="width: 108px">
            <asp:Label ID="Label1" runat="server" Text="Facility type:"></asp:Label></td>
        <td style="width: 207px">
            <asp:DropDownList ID="cmbFacType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="cmbFacType_SelectedIndexChanged" OnDataBound="cmbFacType_SelectedIndexChanged" >
            </asp:DropDownList></td>
        <td style="width: 172px">
            </td>
    </tr>
    <tr>
        <td style="width: 108px">
            <asp:Label ID="lblFacility" runat="server" Text="Facility:"></asp:Label></td>
        <td style="width: 207px">
            <asp:DropDownList ID="cmbFacility" runat="server">
            </asp:DropDownList></td>
        <td style="width: 172px">
           <a href="#" onclick="redirect();">View</a></td>
    </tr>
    </table>
</asp:Panel>
<asp:Panel ID="pnlDetails" runat="server">
    <table>
    <tr>
        <td style="width: 108px">
            <asp:Label ID="Label2" runat="server" Text="First location:"></asp:Label></td>
        <td style="width: 207px">
            <asp:DropDownList ID="cmbFirstLoc" runat="server">
            </asp:DropDownList></td>
        <td style="width: 172px">
            <a href="Default.aspx?ctrl=fac_place">Choose other facility</a></td>
    </tr>
    <tr>
        <td style="width: 108px; height: 40px;">
            <asp:Label ID="Label3" runat="server" Text="Second location:"></asp:Label></td>
        <td style="width: 207px; height: 40px;">
            <asp:DropDownList ID="cmbSecondLoc" runat="server">
            </asp:DropDownList></td>
        <td style="width: 172px; height: 40px;">
            </td>
    </tr>
    <tr>
        <td style="width: 108px; height: 21px">
        </td>
        <td style="width: 207px; height: 21px">
            <asp:LinkButton ID="lnkAdd" runat="server" CssClass="c_button" OnClick="lnkAdd_Click">Add</asp:LinkButton>
            </td>
        <td style="width: 172px; height: 21px">
        </td>
    </tr>
    <tr>
        <td style="width: 108px">
        </td>
        <td style="width: 207px">
        </td>
        <td style="width: 172px">
        </td>
    </tr>
</table>
<asp:Label ID="Label4" runat="server" Text="Locations this facility type  support:"></asp:Label><br />
<asp:GridView ID="dgrSupportedFac" runat="server" AutoGenerateColumns="False" CssClass="list_table" DataKeyNames="Id" OnRowDeleting="dgrSupportedFac_RowDeleting">
    <Columns>
        
        <asp:TemplateField HeaderText="Departure place" ItemStyle-HorizontalAlign="center">
            <ItemTemplate>
            <asp:Label ID="lblDepPlace" runat="server" Text='<%#Eval("DepartureLocation.Name") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Arrival place" ItemStyle-HorizontalAlign="center">
            <ItemTemplate>
            <asp:Label ID="lblArvPlace" runat="server" Text='<%#Eval("ArrivalLocation.Name") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Facility" ItemStyle-HorizontalAlign="center">
            <ItemTemplate>
            <asp:Label ID="lblDepPlace" runat="server" Text='<%#Eval("Facility.Name") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:CommandField ShowDeleteButton="True" />
    </Columns>
</asp:GridView>
</asp:Panel>
<script type="text/javascript" language="javascript">    
	window.location.hash="<%=ActiveAccording %>";
</script>